using System;
using Cysharp.Threading.Tasks;

namespace EventBus
{
    /// <summary>
    /// 监听方是Func的方式异步处理事件
    /// </summary>
    public interface IEventListenerFuncAsync
    {
        /// <summary>
        /// 以异步回调的方式处理监听的事件， 并提供返回值
        /// </summary>
        /// <param name="eventName">事件名</param>
        /// <param name="callback">异步回调函数</param>
        /// <typeparam name="TResult">返回值的类型</typeparam>
        void Listen<TResult>(string eventName, Func<UniTask<TResult>> callback);
        void Listen<T, TResult>(string eventName, Func<T, UniTask<TResult>> callback);
        void Listen<T1, T2, TResult>(string eventName, Func<T1, T2, UniTask<TResult>> callback);
        void Listen<T1, T2, T3, TResult>(string eventName, Func<T1, T2, T3, UniTask<TResult>> callback);
        void Listen<T1, T2, T3, T4, TResult>(string eventName, Func<T1, T2, T3, T4, UniTask<TResult>> callback);
        void Listen<T1, T2, T3, T4, T5, TResult>(string eventName, Func<T1, T2, T3, T4, T5, UniTask<TResult>> callback);
        void Listen<T1, T2, T3, T4, T5, T6, TResult>(string eventName, Func<T1, T2, T3, T4, T5, T6, UniTask<TResult>> callback);
        void Listen<T1, T2, T3, T4, T5, T6, T7, TResult>(string eventName, Func<T1, T2, T3, T4, T5, T6, T7, UniTask<TResult>> callback);
        void Listen<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(string eventName, Func<T1, T2, T3, T4, T5, T6, T7, T8, UniTask<TResult>> callback);
    }
}